package com.molin.IOtest.copyFileTest;

import java.io.*;

public class Demo4 {
    public static void main(String[] args) throws IOException {
        String path = "D:\\IdeaProjects\\BasicCode\\mIdeaTest\\src\\com\\molin\\IOtest\\copyFileTest\\a.avi";
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(path));
        String pathTo = "D:\\IdeaProjects\\BasicCode\\mIdeaTest\\src\\com\\molin\\IOtest\\copyFileTest\\end.avi";

        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(pathTo));

        int len;
        byte[] bytes=new byte[1024];
        while ((len = bis.read(bytes)) != -1) {
            bos.write(len);
        }
        bis.close();
        bos.close();
    }
}
